fix: add modelgen support for granular read ops#537
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #537 +/- ##
=======================================
Coverage 85.69% 85.69%
=======================================
Files 148 148
Lines 7380 7380
Branches 1962 1962
=======================================
Hits 6324 6324
Misses 959 959
Partials 97 97 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| list: 'ModelOperation.LIST', | ||
| sync: 'ModelOperation.SYNC', | ||
| listen: 'ModelOperation.LISTEN', | ||
| search: 'ModelOperation.SEARCH', |
There was a problem hiding this comment.
Are we changing the behavior for only appsync-java-visitor or all other visitors as well? I assume this generateAuthRules method is common to all visitors? If that's the case, can we move this to a common visitor? Thanks
There was a problem hiding this comment.
This is for java visitor only. It maps the input operation to the library-defined enum value. If not added here, the code in java will be generated as empty string.
For the other code generators, these ops will be simply parsed and generated in the final code and do not need additional mapping. You can see this in the snapshot changes for other visitors
There was a problem hiding this comment.
- Swift: https://github.com/aws-amplify/amplify-codegen/pull/537/files#diff-b728b3bfd6e02d0683386efa2a8a74b95cc6f624d5f450db27764fe7edfac671R53-R55
- JS: https://github.com/aws-amplify/amplify-codegen/pull/537/files#diff-cc6588d1d5a98c0aba946398191679c0e2c1dbc8cc27d0c8b61e1a6d10cf34eeR2781-R2797
- Flutter: https://github.com/aws-amplify/amplify-codegen/pull/537/files#diff-38d85adcb8cc38618dae4676dc8ef3ae8c13ecf2fc73bbb00ce96519e7cbe2c6R3109-R3115
Description of changes
Added granular modelgen support for Java
For the other libraries, the generated code has no problem and only library support is needed
Issue #, if available
aws-amplify/amplify-flutter#2526
Description of how you validated changes
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.